Skip to content

fix(cli): skip contrast on transparent backdrops#2313

Open
miguel-heygen wants to merge 1 commit into
mainfrom
fix/transparent-overlay-contrast
Open

fix(cli): skip contrast on transparent backdrops#2313
miguel-heygen wants to merge 1 commit into
mainfrom
fix/transparent-overlay-contrast

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

Summary

  • capture contrast measurement PNGs with alpha preserved in both check and legacy validate
  • skip a text candidate when its sampled backdrop remains transparent, because the downstream live-video background is unknown
  • retain contrast checks for text over opaque cards/panels inside otherwise transparent compositions
  • add browser-script regression coverage for transparent sampled pixels

Reproduction

A transparent 1080x340 composition with white overlay text fails every contrast sample at 1:1 because Chromium flattens the measurement screenshot onto white before the audit samples it. The actual WebM is composited over live video, so the claimed background and WCAG failure are invented.

Verification

  • 56 focused CLI/browser-audit tests pass
  • CLI typecheck passes
  • formatting passes
  • end-to-end transparent-root check --json changes from five hard contrast failures to a clean result with zero contrast candidates

Documentation note

The requested VP9 alpha-probe guidance already exists in docs/guides/rendering.mdx: check ALPHA_MODE=1 and decode with -c:v libvpx-vp9; plain native-decoder pix_fmt=yuv420p is expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant